<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:shiro="http://shiro.apache.org/tags">

    <h:body>
        <ui:composition>
            <!-- #menu: the main large box site menu -->
            <div class="width" style="display: box; margin-left: auto; margin-right: auto">
            <nav class="navbar navbar-default">
                <div class="container-fluid">
                  <!-- Brand and toggle get grouped for better mobile display -->
                  <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                      <span class="sr-only">Toggle navigation</span>
                      <span class="icon-bar"></span>
                      <span class="icon-bar"></span>
                      <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#{request.contextPath}/home.xhtml">Accueil</a>
                  </div>

                  <!-- Collect the nav links, forms, and other content for toggling -->
                  <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                      <ul class="nav navbar-nav">
                          <li><a href="#{request.contextPath}/produits.xhtml">Produits <span class="sr-only"></span></a></li>
                          <li><a href="#{request.contextPath}/list_categories.xhtml">Categorie <span class="sr-only"></span></a></li>
                        <li><a href="#{request.contextPath}/panier.xhtml">Panier</a></li>
                        <shiro:notAuthenticated>
                          <li><a href="#{request.contextPath}/login.xhtml">S'identifier</a></li>
                        </shiro:notAuthenticated>
                        <shiro:authenticated>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Bonjour #{loginController.user.username}<b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                        <li><a href="#{request.contextPath}/private/account.xhtml">Voir panier</a></li>
                                        <li><a href="#">Voir les commandes</a></li>
                                        <div class="divider"></div>
                                    <h:form>    
                                        <li><h:commandLink actionListener="#{loginController.doLogout()}">Se déconnecter</h:commandLink></li>
                                    </h:form>
                                </ul>
                            </li>
                        </shiro:authenticated>
                    </ul>
                    <form class="navbar-form navbar-right" role="search">
                      <div class="form-group">
                        <input type="text" class="form-control" placeholder="Search"/>
                      </div>
                      <button type="submit" class="btn btn-default">Submit</button>
                    </form>
                  </div><!-- /.navbar-collapse -->
                </div><!-- /.container-fluid -->
              </nav>
            </div>
            <!-- #menu end -->
        </ui:composition>
    </h:body>
</html>

